using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._ToRaster
{
    /// <summary>
    /// <para>Point to Raster</para>
    /// <para>Converts point features to a raster dataset.</para>
    /// <para>将点要素转换为栅格数据集。</para>
    /// </summary>    
    [DisplayName("Point to Raster")]
    public class PointToRaster : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PointToRaster()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The point or multipoint input feature dataset to be converted to a raster.</para>
        /// <para>要转换为栅格的点或多点输入要素数据集。</para>
        /// </param>
        /// <param name="_value_field">
        /// <para>Value field</para>
        /// <para><xdoc>
        ///   <para>The field used to assign values to the output raster.</para>
        ///   <para>It can be any field of the input feature dataset's attribute table.</para>
        ///   <para>If the Shape field of a point or multipoint dataset contains z- or m-values, either of these can be used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于为输出栅格分配值的字段。</para>
        ///   <para>它可以是输入要素数据集属性表的任意字段。</para>
        ///   <para>如果点或多点数据集的形状字段包含 z 值或 m 值，则可以使用其中任一值。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_rasterdataset">
        /// <para>Output Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The output raster dataset to be created.</para>
        ///   <para>If the output raster will not be saved to a geodatabase, specify .tif for TIFF file format, .CRF for CRF file format, .img for ERDAS IMAGINE file format, or no extension for Esri Grid raster format.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的输出栅格数据集。</para>
        ///   <para>如果输出栅格不会保存到地理数据库中，请为 TIFF 文件格式指定 .tif 。CRF 表示 CRF 文件格式，.img 表示 ERDAS IMAGINE 文件格式，或者 Esri Grid 栅格格式没有扩展名。</para>
        /// </xdoc></para>
        /// </param>
        public PointToRaster(object _in_features, object _value_field, object _out_rasterdataset)
        {
            this._in_features = _in_features;
            this._value_field = _value_field;
            this._out_rasterdataset = _out_rasterdataset;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Point to Raster";

        public override string CallName => "conversion.PointToRaster";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "pyramid", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_features, _value_field, _out_rasterdataset, _cell_assignment.GetGPValue(), _priority_field, _cellsize, _build_rat.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The point or multipoint input feature dataset to be converted to a raster.</para>
        /// <para>要转换为栅格的点或多点输入要素数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Value field</para>
        /// <para><xdoc>
        ///   <para>The field used to assign values to the output raster.</para>
        ///   <para>It can be any field of the input feature dataset's attribute table.</para>
        ///   <para>If the Shape field of a point or multipoint dataset contains z- or m-values, either of these can be used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于为输出栅格分配值的字段。</para>
        ///   <para>它可以是输入要素数据集属性表的任意字段。</para>
        ///   <para>如果点或多点数据集的形状字段包含 z 值或 m 值，则可以使用其中任一值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _value_field { get; set; }


        /// <summary>
        /// <para>Output Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The output raster dataset to be created.</para>
        ///   <para>If the output raster will not be saved to a geodatabase, specify .tif for TIFF file format, .CRF for CRF file format, .img for ERDAS IMAGINE file format, or no extension for Esri Grid raster format.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的输出栅格数据集。</para>
        ///   <para>如果输出栅格不会保存到地理数据库中，请为 TIFF 文件格式指定 .tif 。CRF 表示 CRF 文件格式，.img 表示 ERDAS IMAGINE 文件格式，或者 Esri Grid 栅格格式没有扩展名。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_rasterdataset { get; set; }


        /// <summary>
        /// <para>Cell assignment type</para>
        /// <para><xdoc>
        ///   <para>The method to determine how the cell will be assigned a value when more than one feature falls within a cell.</para>
        ///   <bulletList>
        ///     <bullet_item>Most frequent—If there is more than one feature within the cell, the one with the most common attribute, in the Value field, is assigned to the cell. If they have the same number of common attributes, the one with the lowest FID is used.</bullet_item><para/>
        ///     <bullet_item>Sum—The sum of the attributes of all the points within the cell (not valid for string data).</bullet_item><para/>
        ///     <bullet_item>Mean—The mean of the attributes of all the points within the cell (not valid for string data).</bullet_item><para/>
        ///     <bullet_item>Standard deviation—The standard deviation of attributes of all the points within the cell. If there are less than two points in the cell, the cell is assigned NoData (not valid for string data).</bullet_item><para/>
        ///     <bullet_item>Maximum—The maximum value of the attributes of the points within the cell (not valid for string data).</bullet_item><para/>
        ///     <bullet_item>Minimum—The minimum value of the attributes of the points within the cell (not valid for string data).</bullet_item><para/>
        ///     <bullet_item>Range—The range of the attributes of the points within the cell (not valid for string data).</bullet_item><para/>
        ///     <bullet_item>Count—The number of points within the cell.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定当多个要素位于一个单元格中时如何为单元格分配值的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>最频繁 - 如果单元格中有多个要素，则将值字段中具有最常见属性的要素分配给单元格。如果它们具有相同数量的公共属性，则使用具有最低 FID 的属性。</bullet_item><para/>
        ///     <bullet_item>Sum - 单元格内所有点的属性之和（对字符串数据无效）。</bullet_item><para/>
        ///     <bullet_item>均值 - 单元格内所有点的属性的平均值（对字符串数据无效）。</bullet_item><para/>
        ///     <bullet_item>标准差 - 像元内所有点的属性的标准差。如果单元格中的点少于两个，则为单元格分配 NoData（对字符串数据无效）。</bullet_item><para/>
        ///     <bullet_item>最大值 - 单元格内点属性的最大值（对字符串数据无效）。</bullet_item><para/>
        ///     <bullet_item>最小值 - 单元格内点属性的最小值（对字符串数据无效）。</bullet_item><para/>
        ///     <bullet_item>范围 - 单元格内点的属性范围（对字符串数据无效）。</bullet_item><para/>
        ///     <bullet_item>计数 - 单元格内的点数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cell assignment type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _cell_assignment_value _cell_assignment { get; set; } = _cell_assignment_value._MOST_FREQUENT;

        public enum _cell_assignment_value
        {
            /// <summary>
            /// <para>Most frequent</para>
            /// <para>Most frequent—If there is more than one feature within the cell, the one with the most common attribute, in the Value field, is assigned to the cell. If they have the same number of common attributes, the one with the lowest FID is used.</para>
            /// <para>最频繁 - 如果单元格中有多个要素，则将值字段中具有最常见属性的要素分配给单元格。如果它们具有相同数量的公共属性，则使用具有最低 FID 的属性。</para>
            /// </summary>
            [Description("Most frequent")]
            [GPEnumValue("MOST_FREQUENT")]
            _MOST_FREQUENT,

            /// <summary>
            /// <para>Sum</para>
            /// <para>Sum—The sum of the attributes of all the points within the cell (not valid for string data).</para>
            /// <para>Sum - 单元格内所有点的属性之和（对字符串数据无效）。</para>
            /// </summary>
            [Description("Sum")]
            [GPEnumValue("SUM")]
            _SUM,

            /// <summary>
            /// <para>Mean</para>
            /// <para>Mean—The mean of the attributes of all the points within the cell (not valid for string data).</para>
            /// <para>均值 - 单元格内所有点的属性的平均值（对字符串数据无效）。</para>
            /// </summary>
            [Description("Mean")]
            [GPEnumValue("MEAN")]
            _MEAN,

            /// <summary>
            /// <para>Standard deviation</para>
            /// <para>Standard deviation—The standard deviation of attributes of all the points within the cell. If there are less than two points in the cell, the cell is assigned NoData (not valid for string data).</para>
            /// <para>标准差 - 像元内所有点的属性的标准差。如果单元格中的点少于两个，则为单元格分配 NoData（对字符串数据无效）。</para>
            /// </summary>
            [Description("Standard deviation")]
            [GPEnumValue("STANDARD_DEVIATION")]
            _STANDARD_DEVIATION,

            /// <summary>
            /// <para>Maximum</para>
            /// <para>Maximum—The maximum value of the attributes of the points within the cell (not valid for string data).</para>
            /// <para>最大值 - 单元格内点属性的最大值（对字符串数据无效）。</para>
            /// </summary>
            [Description("Maximum")]
            [GPEnumValue("MAXIMUM")]
            _MAXIMUM,

            /// <summary>
            /// <para>Minimum</para>
            /// <para>Minimum—The minimum value of the attributes of the points within the cell (not valid for string data).</para>
            /// <para>最小值 - 单元格内点属性的最小值（对字符串数据无效）。</para>
            /// </summary>
            [Description("Minimum")]
            [GPEnumValue("MINIMUM")]
            _MINIMUM,

            /// <summary>
            /// <para>Range</para>
            /// <para>Range—The range of the attributes of the points within the cell (not valid for string data).</para>
            /// <para>范围 - 单元格内点的属性范围（对字符串数据无效）。</para>
            /// </summary>
            [Description("Range")]
            [GPEnumValue("RANGE")]
            _RANGE,

            /// <summary>
            /// <para>Count</para>
            /// <para>Count—The number of points within the cell.</para>
            /// <para>计数 - 单元格内的点数。</para>
            /// </summary>
            [Description("Count")]
            [GPEnumValue("COUNT")]
            _COUNT,

        }

        /// <summary>
        /// <para>Priority field</para>
        /// <para><xdoc>
        ///   <para>This field is used when a feature should take preference over another feature with the same attribute.</para>
        ///   <para>Priority field is only used with the Most frequent cell assignment type option.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>当一个要素应优先于具有相同属性的另一个要素时，将使用此字段。</para>
        ///   <para>优先级字段仅与“最频繁的单元格分配类型”选项一起使用。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Priority field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _priority_field { get; set; } = null;


        /// <summary>
        /// <para>Cellsize</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster being created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn’t been explicitly specified as the parameter value, the environment cell size value is used, if specified; otherwise, additional rules are used to calculate it from the other inputs. See Usages for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>正在创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未显式指定像元大小作为参数值，则使用环境像元大小值（如果已指定）;否则，将使用其他规则从其他输入中计算它。有关详细信息，请参阅用法。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cellsize")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cellsize { get; set; } = null;


        /// <summary>
        /// <para>Build raster attribute table</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output raster will have a raster attribute table.</para>
        ///   <para>This parameter only applies to integer rasters.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The output raster will have a raster attribute table. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The output raster will not have a raster attribute table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出栅格是否具有栅格属性表。</para>
        ///   <para>此参数仅适用于整数栅格。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 输出栅格将具有栅格属性表。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 输出栅格将不具有栅格属性表。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Build raster attribute table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _build_rat_value _build_rat { get; set; } = _build_rat_value._true;

        public enum _build_rat_value
        {
            /// <summary>
            /// <para>BUILD</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("BUILD")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_BUILD</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_BUILD")]
            [GPEnumValue("false")]
            _false,

        }

        public PointToRaster SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object pyramid = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, pyramid: pyramid, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}